package array;

import java.util.Scanner;

public class Array {
	public static void main(String[] args) {

		int[][] arr = new int[5][5];

		for (int i = 0; i < arr.length - 1; i++) {

			for (int k = 0; k < 5 - i; k++) {
				System.out.print(" ");
			}

			for (int j = 0; j < 2 * i - 1; j++) {

				if (j == 0 || i == j) {
					arr[i][j] = 1;
				} else {
					arr[i][j] = arr[i - 1][j - 1] + arr[i - 1][j];
				}
				System.out.print(arr[i][j]);
			}
			System.out.println();
		}

		float sum = 0f;
		float average = 0f;
		float max = 0f;
		float min = 0f;
		Scanner scanner = new Scanner(System.in);
		float[] a = new float[5];

		for (int i = 0; i < a.length - 1; i++) {
			for (int j = 0; j < a.length - 1 - i; j++) {

			}
		}

		for (int i = 0; i < 5; i++) {

			a[i] = scanner.nextFloat();
			sum = sum + a[i];
			if (max == 0)
				max = a[0];
			if (min == 0)
				min = a[0];
			if (max < a[i])
				max = a[i];
			if (min > a[i])
				min = a[i];
		}

		average = sum / a.length;

		System.out.println(sum);
		System.out.println(average);
		System.out.println(max);
		System.out.println(min);

		float score = scanner.nextFloat();
		for (int i = 0; i < a.length; i++) {

			if (score == a[i]) {
				System.out.println(i);
			}
		}

		scanner.close();

	}

}
